// import { getPost } from '@/libs/ajax.js'
// 存储
const state = {
  tableData: [],
  count: 0,
  curPage: 0,
  pageSize: 0
}
// 获取
const getters = {
  getTableData: state => state.tableData
}

// 异步
const actions = {
  fetchTableData ({ commit, state }) {
    // getPost('/aut/myTestTab/findList', {}, (data, all) => {
    //   // console.log(data)
    //   commit('setTableData', data)
    //   commit('setCount', all.count)
    //   commit('setPageSize', all.pageSize)
    // })
  }

}

// 同步
const mutations = {
  setTableData (state, tableData) {
    state.tableData = tableData
  },
  setCount (state, count) {
    state.count = count
  },
  // 当前页
  setPageNum (state, curPage) {
    state.curPage = curPage
  },
  setPageSize (state, pageSize) {
    state.pageSize = pageSize
  }
}

const module = {
  namespaced: true,
  state,
  getters,
  actions,
  mutations
}
export default module
